<%= form_for topic,
             url: topic.submit_path,
             html: {
                 class: "thredded--form thredded--new-topic-form #{local_assigns[:css_class]}",
                 'data-thredded-topic-form' => true,
                 'data-autocomplete-url' => autocomplete_users_path,
                 'data-autocomplete-min-length' => Thredded.autocomplete_min_length,
                 'data-thredded-submit-hotkey' => true,
             } do |form| %>
  <%= hidden_field_tag("next_page", params[:next_page]) %>

  <ul class="thredded--form-list on-top">
    <li class="title">
      <%= form.label :title, t('thredded.topics.form.title_label') %>
      <%= form.text_field :title, placeholder: placeholder, required: true, autocomplete: 'off' %>
      <%= render 'thredded/shared/field_errors', messages: form.object.errors[:title] %>
    </li>

    <% if form.object.category_options.any? %>
      <li class="category">
        <%= form.select :category_ids,
                        form.object.category_options,
                        {},
                        { multiple: true, 'data-placeholder' => t('thredded.topics.form.categories_placeholder') } %>
      </li>
    <% end %>

    <%= render 'thredded/posts_common/form/content',
               form: form,
               content_label: t('thredded.topics.form.content_label'),
               preview_url: topic.preview_path %>
    <%= render 'thredded/topics/topic_form_admin_options', form: form %>

    <li><%= form.submit t('thredded.topics.form.create_btn'), class: 'thredded--form--submit' %></li>
  </ul>
<% end %>
